import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { GoodsOrderEvaluateVO, GoodsOrderEvaluateForm, GoodsOrderEvaluateQuery } from '@/api/system/goodsOrderEvaluate/types';

/**
 * 查询商城订单评价列表
 * @param query
 * @returns {*}
 */

export const listGoodsOrderEvaluate = (query?: GoodsOrderEvaluateQuery): AxiosPromise<GoodsOrderEvaluateVO[]> => {
  return request({
    url: '/system/goodsOrderEvaluate/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询商城订单评价详细
 * @param id
 */
export const getGoodsOrderEvaluate = (id: string | number): AxiosPromise<GoodsOrderEvaluateVO> => {
  return request({
    url: '/system/goodsOrderEvaluate/' + id,
    method: 'get'
  });
};

/**
 * 新增商城订单评价
 * @param data
 */
export const addGoodsOrderEvaluate = (data: GoodsOrderEvaluateForm) => {
  return request({
    url: '/system/goodsOrderEvaluate',
    method: 'post',
    data: data
  });
};

/**
 * 修改商城订单评价
 * @param data
 */
export const updateGoodsOrderEvaluate = (data: GoodsOrderEvaluateForm) => {
  return request({
    url: '/system/goodsOrderEvaluate',
    method: 'put',
    data: data
  });
};

/**
 * 删除商城订单评价
 * @param id
 */
export const delGoodsOrderEvaluate = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/goodsOrderEvaluate/' + id,
    method: 'delete'
  });
};
